set more off

eststo clear

foreach city in memphis nashville illinois {

	if "`city'" == "illinois" use "dataset_`city'", clear

	if "`city'" != "illinois" use "dataset_`city' wave 1", clear
  
	gen dropoff = v10 == "0"

	if "`city'" == "illinois" gen ideoself1 = policyself

	if "`city'" == "nashville" local y votebarry1
	if "`city'" == "memphis" local y votestrickland
	if "`city'" == "illinois" local y  

	foreach x in ideoself1 `y' {
	
		eststo: reg `x' dropoff, robust
	
	}

}

gen votebarry1 = .
gen votestrickland = .
label variable dropoff "Dropped Out"
label variable ideoself1 "Conservatism"
label variable votebarry1 "Barry Voter"
label variable votestrickland "Strickland Voter"

#delimit;

esttab
	using "table A2 b.tex"
	,
		booktabs
		width(\linewidth)
		replace
		se 
		compress 
		cells(b(fmt(3) star) se(par))
		collabels(none)
		label
		mgroups(
			"Memphis"
			"Nashville"
			"Illinois"
			 ,
				pattern(1 0 1 0 1)
				prefix(\multicolumn{@span}{c}{) suffix(}) 
				span 
				erepeat(\cmidrule(lr){@span})
		)

		;

#delimit cr
